package com.its.web;

import com.github.pagehelper.PageInfo;
import com.its.pojo.BusImage;
import com.its.pojo.HupCompany;
import com.its.service.BusImageService;
import com.its.service.HupCompanyService;
import com.its.util.HttpStatusEnum;
import com.its.util.Result;
import com.its.web.param.HupCompanyControllerParam;
import io.swagger.annotations.Api;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 朱厚强
 * @since 2024年01月03日
 */
@RestController
@RequestMapping("/busImage")
@Api(tags = "数据采集 -api")
public class BusImageController {
    @Autowired
    private BusImageService service;
    /**
     * 根据报案号id获取图片信息
     * @return
     */
    @GetMapping("/getByReportId/{reportId}")
    public Result getById(@PathVariable String reportId){
        return service.getByReportId(reportId);
    }
    /**
     * 添加采集数据信息
     */
    @PostMapping("/addImg/{reportId}/{type}")
    public Result addImg(@RequestBody MultipartFile file, @PathVariable String reportId, @PathVariable Integer type ){
        return service.addImg(file, reportId,type);
    }
    /**
     * 删除采集数据信息
     */
    @DeleteMapping("/delImg/{id}")
    public Result addImg( @PathVariable Long id ){
        return service.delImg(id);
    }
//    /**
//     * 删除采集数据信息
//     */
//    @PostMapping("/delImg/{id}")
//    public Result addImg( @RequestBody MultipartFile file ){
//        return service.delImg(file.);
//    }
}
